//
//  CFLoginViewController.m
//  CFfuturestalent
//
//  Created by 子yu 刘 on 2018/4/17.
//  Copyright © 2018年 子yu 刘. All rights reserved.
//

#import "CFLoginViewController.h"

@interface CFLoginViewController ()

@property (weak, nonatomic) IBOutlet UITextField *loginName;
@property (weak, nonatomic) IBOutlet UITextField *loginPwd;
@property (weak, nonatomic) IBOutlet UIButton *loginBtn;



@end

@implementation CFLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [[self.loginBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        [self loginNetwork];
    }];
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem backItemWithTitle:@"取消" target:self action:@selector(back)];
}

- (void)loginNetwork{
    
    NSString *urlStr = @"http://htmmarket.fx678.com/unixtime.php";
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
    manager.requestSerializer=[AFHTTPRequestSerializer serializer];
    
    [manager GET:urlStr parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSData *strData = responseObject;
        
        NSString *name =  [[NSString alloc]initWithData:strData encoding:NSUTF8StringEncoding];
        
        
        
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
    

    
//    [RequestOperationManager LoginWithMoble:self.loginName.text paw:self.loginPwd.text success:^(id result) {
//
//
//    } failture:^(NSError *error) {
//
//    }];

}

-(void)back{
    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
}


@end
